協同產品設計 40823153

  • Home
    • Site Map
    • reveal
    • blog
  • 個人簡介
  • stage1-ag21
    • w1
      • leo
    • w2
      • inventor 圖檔
      • coppeliaSim拋物線動力模擬
      • inventor 模擬測試教學
      • inventor 拋物線動力模擬
    • w3
    • w4
  • stage2-ag12
    • 工作分配
    • 產品目標
    • w5
      • inventor版本2.1
    • w6
      • inventer 版本2.2
      • CoppeliaSim v-rep 2.2
    • w7
      • inventor2.3
      • CoppliaSim v-rep 2.3
    • w8
      • inventor 2.4
      • CoppeliaSim v-rep 2.4
    • 協同報告
  • task
    • w10
      • task1
      • task2
    • w15
      • 第一部 Inverse kinematics for a 2-joint robot arm using geometry
      • 第二部 Inverse kinematics for a 2-joint robot arm using algebra
    • w16
      • 1.Onshape 零組件繪製
      • 2.CoppeliaSim vrep 鍵盤控制
      • 3.CoppeliaSim vrep 新增吸盤
      • 4.逆向運動學函式
      • 5.Python remote API 逆向運動學函式
      • require的補充
  • stage3-ag6
    • w17
      • 1.Basketball machine senser
      • 2.Basketball machine Slider
      • 3.Basketball machine by MTB_Robot
1.Onshape 零組件繪製 << Previous Next >> 3.CoppeliaSim vrep 新增吸盤

2.CoppeliaSim vrep 鍵盤控制

雲端檔案

MTB_Robot(Two axis)

控制程式

function sysCall_init()
    -- do some initialization here
     axis4=sim.getObjectHandle('MTB_axis3')
     axis0=sim.getObjectHandle('MTB_axis1')
     axis8=sim.getObjectHandle('MTB_axis5')
     axis2=sim.getObjectHandle('MTB_axis3')     
     rotation2 = 0
     distance3 = 0
     deg = math.pi/180
     --sim.sJointTargetVelocity(joint,5.5)
end
function sysCall_actuation()
 calibration = 0.0042
 message,auxiliaryData=sim.getSimulatorMessage()
 if (message==sim.message_keypress) then
      print(auxiliaryData[1])--key
      if (auxiliaryData[1]==string.byte(' ')) then
      end
      if (auxiliaryData[1]==97) then--a
      rotation1 = rotation1 + 5*deg
      sim.setJointPosition(axis1, rotation1)
      end
      if (auxiliaryData[1]==100) then --d
      rotation1 = rotation1 - 5*deg
      sim.setJointPosition(axis1, rotation1)
      end
      end
      if (auxiliaryData[1]==2007) then --up
      distance3 = distance3 + 0.01 + calibration
      sim.setJointPosition(axis3, distance3)
      end
      if (auxiliaryData[1]==2008) then --down
      distance3 = distance3 - 0.01 - calibration
      sim.setJointPosition(axis3, distance3)
      end
      
 end   
 
end
function sysCall_sensing()
    -- put your sensing code here
end
 
function sysCall_cleanup()
    -- do some clean-up here
end
 
-- See the user manual or the available code snippets for additional callback functions and details

1.Onshape 零組件繪製 << Previous Next >> 3.CoppeliaSim vrep 新增吸盤

Copyright © All rights reserved | This template is made with by Colorlib